# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=python-flask-caching
pkgver=2.0.2
pkgrel=3
pkgdesc="Adds caching support to your Flask application"
url="https://github.com/sh4nks/flask-caching"
license=('BSD')
arch=('any')
depends=('python-flask' 'python-cachelib')
makedepends=('python-setuptools')
checkdepends=('python-pytest-runner' 'python-pytest-cov' 'python-pytest-xprocess'
              'python-pylibmc' 'python-redis' 'memcached' 'python-asgiref')
source=("$pkgname-$pkgver.tar.gz::https://github.com/sh4nks/flask-caching/archive/v$pkgver.tar.gz")
sha512sums=('b019c3e74ebb65bb34eb08cdc886a70694ea218116c84ff3e57e3167da23bef1d50baa94c747557784e440eee5166084a4cdaa9082afe3b914ed012ff143a4c4')

prepare() {
  cd flask-caching-$pkgver
  sed -i 's/, < 0.10.0//' setup.py
}

build() {
  cd flask-caching-$pkgver
  python setup.py build
}

check() {
  cd flask-caching-$pkgver
  python setup.py pytest
}

package() {
  cd flask-caching-$pkgver
  python setup.py install --root="$pkgdir" --optimize=1
  install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}
